from django.conf.urls.defaults import patterns, include, url
from django.contrib.auth.views import logout, login
import settings

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    url(r'^logout/.*$', logout, {'next_page':'/accounts/login',}),
    url(r'^lessons/$', 'pybo.mylessons.views.index'),
    url(r'^$', 'pybo.mylessons.views.index'),
    url(r'^accounts/profile/$', 'pybo.mylessons.views.index'),
    url(r'^lessons/(?P<lesson_id>\d+)/$', 'pybo.mylessons.views.content'),
    url(r'^submits/(?P<problem_id>\d+)/$', 'pybo.myproblems.views.submits'),
    url(r'^lessons/(?P<lesson_id>\d+)/noaccess$', 'pybo.mylessons.views.lesson_noaccess'),
    url(r'^lessons/(?P<lesson_id>\d+)/(?P<edit>[a-z]+)$', 'pybo.mylessons.views.content'),
    url(r'^lessons/(?P<lesson_id>\d+)/UP/(?P<node_id>\d+)/$', 'pybo.mylessons.views.node_up'),
    url(r'^accounts/login/', 'django.contrib.auth.views.login'),
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
    url(r'^admin/', include(admin.site.urls)),
)
urlpatterns += patterns('',
        url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
            'document_root': settings.MEDIA_ROOT,
        }),
 )
